<?php

require_once BASE_PATH.'application/models/basedao'.EXT;

class mybodyDAO extends baseDAO {
	
	var $table = 'my_body';
	var $key   = 'id_my_body';
	var $sql   = '';

	function __construct()
	{
	    parent::__construct();
	}
	function _defaultSQL()
	{
		$this->db->select('id_my_body, titulo, imagen, descripcion');
	}
	
    function getMyBody($semana)
	{
        $this->_defaultSQL();
		$this->db->where(array("id_my_body ="=>$semana));
		$this->db->limit(1);
		$query = $this->db->get($this->table);
		return $query->result_array();
    }
	
	function get_last_id()
    {
        $this->db->select_max('id_my_body');
        $this->db->limit(1);
        $query = $this->db->get($this->table);
		return $query->result_array();
    }
}

?>